<?php
/**
 * @package     Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$root_path = JURI::root();
$tpath = $root_path.'templates/cnsolution/';

//get data
$name_sub_catDesign = ContentHelperCnsolution::getNameOfSubCat(intval($this->catid_design));
$data_design_article = ContentHelperCnsolution::getDataByCatId(intval($this->catid_design));

//var_dump(ContentHelperCnsolution::getNameOfCatFromCatID(14)) ; die;
?>
<!-- SUBHEADER
================================================== -->
<div id="subheader">
    <div class="row">
        <div class="twelve columns">
            <p>
                DESIGN PORTOFOLIO
            </p>
        </div>
    </div>
</div>
<div class="hr">
</div>
<!-- CONTENT
================================================== -->
<div class="row">
    <div class="twelve columns">
        <!-- CATEGORIES-->
        <section id="options" class="clearfix">
            <ul id="filters" class="option-set clearfix" data-option-key="filter">
                <li><a href="#filter" data-option-value="*" class="portofoliobutton selected">Show all</a></li>
                <?php foreach($name_sub_catDesign as $value): ?>
                    <li><a href="#filter" data-option-value=".<?php echo strtolower($value->title); ?>" class="portofoliobutton">
                            <?php echo ucfirst(strtolower($value->title));?></a>
                    </li>
                <?php endforeach; ?>
            </ul>
        </section>
    </div>
</div>
<div id="portofolio" class="row">
    <?php foreach($data_design_article as $value):?>
    <div class="six columns category
    <?php echo strtolower(ContentHelperCnsolution::getNameOfCatFromCatID(intval($value->catid)) ); ?> ">
        <h5><?php echo strtoupper($value->title); ?></h5>
        <p>
            <?php echo ContentHelperCnsolution::truncateDataFilter(strip_tags($value->content),20); ?>
        </p>
        <div class="portofoliothumb">
            <?php
            //data small image
            $value_img_obj = json_decode($value->images);
            $thumb_image['link_image'] = $value_img_obj->image_intro;
            $thumb_image['alt']  = $value_img_obj->image_intro_alt;
            $thumb_image['caption']  = $value_img_obj->image_intro_caption;

            //get link article
            $slug = $value->alias ? ($value->id . ':' . $value->alias) : $value->id;
            $links_article = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $value->catid, $value->language));
            ?>
            <div class="portofoliothumboverlay">
                <div class="viewgallery">
                    <!--image here -->
                    <a data-gal="prettyPhoto[gallery]" href="<?php echo $thumb_image['link_image']; ?>">
                        <img src="<?php echo $tpath;?>images/playgal.png"
                             class="left galleryicon" alt="<?php echo $thumb_image['alt'];?>"> Gallery
                    </a>
                </div>
                <div class="inner">
                    <a class="projectdetail" href="<?php echo $links_article; ?>">+ Project Details</a>
                </div>
            </div>
            <!-- image here -->
            <img src="<?php echo $thumb_image['link_image']; ?>" alt="<?php echo $thumb_image['alt'];?>"/>
        </div>
    </div>
    <?php endforeach; ?>
</div>
<div class="hr">
</div>
